package com.qunduikj.sjb.sdk.model.enums;

/**
 * @author Jovita
 *        "1":"半挂车","2":"厢式货车","3":"普通货车","4":"轻型载货车"(v0.2.0改了)
 */
public enum CarType {
   /* SemiTrailer(1, "半挂车"),
    Van(2, "厢式货车"),
    Truck(3, "普通货车"),
    LightTrack(4, "轻型载货车");*/
    TYPE_SLAB_CAR(1, "平板货车"),
    TYPE_GAOLAN_CAR(2, "高栏货车"),
    TYPE_MPV_CAR(3, "厢式货车"),
    TYPE_HIGHLOW_CAR(4, "高低板货车"),
    TYPE_STORAGE_CAR(5, "保温冷藏货车"),
    TYPE_DANGEROUS_CAR(6, "危险品货车");
    //        slab 平板货车、高栏货车、厢式货车、高低板货车、保温冷藏货车、危险品货车

    // 定义私有变量
    private Integer code;
    private String carType;

    CarType(Integer code, String carType) {
        this.code = code;
        this.carType = carType;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    @Override
    public String toString() {
        return "CarType{" +
                "code=" + code +
                ", carType='" + carType + '\'' +
                '}';
    }

    public static String valueOf(int type) {
        CarType cartype[] = CarType.values();
        for (int i = 0; i < cartype.length; i++) {
            CarType pw = cartype[i];
            if (pw.getCode() == type) {
                return pw.getCarType();
            }
        }
        return "";
    }


}